package com.heima.admin.controller;


import com.heima.admin.annotation.LogModule;
import com.heima.api.user.IUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping()
@RequiredArgsConstructor
public class AdminAuthController {

    private final IUserClient IUserClient;


    @ApiOperation("查询列表")
    @PostMapping("/api/v1/auth/list")
    ResponseResult listAll(@RequestBody AuthDto authDto){
        return IUserClient.listAll(authDto);
    };

    @ApiOperation("审核失败")
    @LogModule("管理员审核")
    @PostMapping("/api/v1/auth/authFail")
    ResponseResult authFail(@RequestBody AuthDto authDto) {

        return IUserClient.authFail(authDto);
    }

    @ApiOperation("审核通过")
    @LogModule("管理员审核")
    @PostMapping("/api/v1/auth/authPass")
    ResponseResult authPass(@RequestBody AuthDto authDto) {
        return IUserClient.authPass(authDto);
    }

}
